<!--主导航-->
<div class="nav category">
    <div class="hot-nav">
        <a {% if data.parentId==''and data.orderByField=='default' %} class="hover" {% endif %}
           href='/answer.html'>全部</a>
    </div>
    <ul class="clearfix main-ul">
        <li>
            <a class="{%if data.orderByField=='answerCount'%} hover {%endif%}"
               href='/answer.html?orderByField=answerCount'>热门</a>
        </li>
        {% for item in data.category %}
        <li>
            <a {% if data.parentId == item.id %} class="hover" {% endif %}
               href='/answer.html?parentId={{item.id}}'>{{ item.name }}</a>
        </li>
        {% endfor %}
    </ul>
</div>
<!--热门下时间筛选-->
{%if data.orderByField=='answerCount'  %}
<div class="nav sub-nav">
    <div class="hot-nav">
        <a  {% if data.beginDateTime == '' %} class="hover" {% endif %}
        href='/answer.html?orderByField={{data.orderByField}}'>全部</a>
    </div>
    <ul class="clearfix">
        <li>
            <a  {% if data.beginDateTime == "week" %} class="hover" {% endif %}
            href='/answer.html?orderByField={{data.orderByField}}&beginDateTime=week'>1周内</a>
        </li>
        <li>
            <a {% if data.beginDateTime == "month" %} class="hover" {% endif %}
            href='/answer.html?orderByField={{data.orderByField}}&beginDateTime=month'>1月内</a>
        </li>
        <li>
            <a {% if data.beginDateTime == "quarter" %} class="hover" {% endif %}
            href='/answer.html?orderByField={{data.orderByField}}&beginDateTime=quarter'>3月内</a>
        </li>
        <li >
            <a {% if data.beginDateTime == "halfyear" %} class="hover" {% endif %}
            href='/answer.html?orderByField={{data.orderByField}}&beginDateTime=halfyear'>半年内</a>
        </li>
    </ul>
</div>
{%else%}
<!--子导航-->
<div class="hide" {% if data.parentId %} style="display:block;" {% endif %}>
    <div class="nav sub-nav category">
        {% for item in data.category %}
        <ul class="hide clearfix" {% if data.parentId==item.child[0].parentId %} style="display:block;" {% endif %}>
            <li>
                <a href='/answer.html?parentId={{item.child[0].parentId}}'
                   {% if data.categoryId==data.parentId and (data.parentId == item.child[0].parentId) %} class="hover" {% endif %}>
                    全部
                </a>
            </li>
            {% for child in item.child %}
            <li>
                <a {% if data.categoryId == child.id %} class="hover" {% endif %}
                   href='/answer.html?parentId={{child.parentId}}&categoryId={{child.id}}'>
                    {{ child.name }}
                </a>
            </li>
            {% endfor %}
        </ul>
        {% endfor %}
        <!-- <span class="more">更多</span>-->
    </div>
</div>
{%endif%}
